load("//:build_variables.bzl", "COPTS")
load("//tools/lint:linters.bzl", "clang_tidy_test")

package(
    default_visibility = ["//:android_cuttlefish"],
)

ALLOW_C = ["-Wno-module-import-in-extern-c"]

cc_library(
    name = "adb_connector",
    srcs = ["adb_connector.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "adb_connector_clang_tidy",
    srcs = [":adb_connector"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "assemble_cvd",
    srcs = ["assemble_cvd.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "assemble_cvd_clang_tidy",
    srcs = [":assemble_cvd"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "avbtool",
    srcs = ["avbtool.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@abseil-cpp//absl/log:check",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "avbtool_clang_tidy",
    srcs = [":avbtool"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "baseline",
    srcs = ["baseline.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "baseline_clang_tidy",
    srcs = [":baseline"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "casimir",
    srcs = ["casimir.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "casimir_clang_tidy",
    srcs = [":casimir"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "casimir_control_server",
    srcs = ["casimir_control_server.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "casimir_control_server_clang_tidy",
    srcs = [":casimir_control_server"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "cf_vhost_user_input",
    srcs = ["cf_vhost_user_input.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "cf_vhost_user_input_clang_tidy",
    srcs = [":cf_vhost_user_input"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "control_env_proxy_server",
    srcs = ["control_env_proxy_server.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "control_env_proxy_server_clang_tidy",
    srcs = [":control_env_proxy_server"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "cvd_internal_start",
    srcs = ["cvd_internal_start.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "cvd_internal_start_clang_tidy",
    srcs = [":cvd_internal_start"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "echo_server",
    srcs = ["echo_server.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "echo_server_clang_tidy",
    srcs = [":echo_server"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "gnss_grpc_proxy",
    srcs = ["gnss_grpc_proxy.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "gnss_grpc_proxy_clang_tidy",
    srcs = [":gnss_grpc_proxy"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "kernel_log_monitor",
    srcs = ["kernel_log_monitor.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "kernel_log_monitor_clang_tidy",
    srcs = [":kernel_log_monitor"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "log_tee",
    srcs = ["log_tee.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "log_tee_clang_tidy",
    srcs = [":log_tee"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "logcat_receiver",
    srcs = ["logcat_receiver.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "logcat_receiver_clang_tidy",
    srcs = [":logcat_receiver"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "metrics",
    srcs = ["metrics.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "metrics_clang_tidy",
    srcs = [":metrics"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "mkenvimage_slim",
    srcs = ["mkenvimage_slim.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "mkenvimage_slim_clang_tidy",
    srcs = [":mkenvimage_slim"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "modem_simulator",
    srcs = ["modem_simulator.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "modem_simulator_clang_tidy",
    srcs = [":modem_simulator"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "netsimd",
    srcs = ["netsimd.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "netsimd_clang_tidy",
    srcs = [":netsimd"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "newfs_msdos",
    srcs = ["newfs_msdos.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "newfs_msdos_clang_tidy",
    srcs = [":newfs_msdos"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "no_policy",
    srcs = ["no_policy.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
    ],
)

clang_tidy_test(
    name = "no_policy_clang_tidy",
    srcs = [":no_policy"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "openwrt_control_server",
    srcs = ["openwrt_control_server.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "openwrt_control_server_clang_tidy",
    srcs = [":openwrt_control_server"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "operator_proxy",
    srcs = ["operator_proxy.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "operator_proxy_clang_tidy",
    srcs = [":operator_proxy"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "process_restarter",
    srcs = ["process_restarter.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "process_restarer_clang_tidy",
    srcs = [":process_restarter"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "run_cvd",
    srcs = ["run_cvd.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@abseil-cpp//absl/strings",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "run_cvd_clang_tidy",
    srcs = [":run_cvd"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "screen_recording_server",
    srcs = ["screen_recording_server.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "screen_recording_server_clang_tidy",
    srcs = [":screen_recording_server"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "secure_env",
    srcs = ["secure_env.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
    ],
)

clang_tidy_test(
    name = "secure_env_clang_tidy",
    srcs = [":secure_env"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "simg2img",
    srcs = ["simg2img.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "simg2img_clang_tidy",
    srcs = [":simg2img"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "socket_vsock_proxy",
    srcs = ["socket_vsock_proxy.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "socket_vsock_proxy_clang_tidy",
    srcs = [":socket_vsock_proxy"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "tcp_connector",
    srcs = ["tcp_connector.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "tcp_connector_clang_tidy",
    srcs = [":tcp_connector"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "tombstone_receiver",
    srcs = ["tombstone_receiver.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "tombstone_receiver_clang_tidy",
    srcs = [":tombstone_receiver"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "vhost_device_vsock",
    srcs = ["vhost_device_vsock.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
    ],
)

clang_tidy_test(
    name = "vhost_device_vsock_clang_tidy",
    srcs = [":vhost_device_vsock"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "webrtc",
    srcs = ["webrtc.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "webrtc_clang_tidy",
    srcs = [":webrtc"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "webrtc_operator",
    srcs = ["webrtc_operator.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "webrtc_operator_clang_tidy",
    srcs = [":webrtc"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "wmediumd",
    srcs = ["wmediumd.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "wmediumd_clang_tidy",
    srcs = [":wmediumd"],
    tags = ["clang_tidy", "clang-tidy"],
)

cc_library(
    name = "wmediumd_gen_config",
    srcs = ["wmediumd_gen_config.cpp"],
    copts = COPTS + ALLOW_C,
    alwayslink = True,
    deps = [
        "//cuttlefish/host/commands/process_sandboxer:policies_header",
        "@sandboxed_api//sandboxed_api/sandbox2/allowlists:unrestricted_networking",
        "@sandboxed_api//sandboxed_api/sandbox2",
        "@sandboxed_api//sandboxed_api/sandbox2/util:bpf_helper",
        "@sandboxed_api//sandboxed_api/util:file_base",
    ],
)

clang_tidy_test(
    name = "wmediumd_gen_config_clang_tidy",
    srcs = [":wmediumd_gen_config"],
    tags = ["clang_tidy", "clang-tidy"],
)
